//
//  BaseRegisterViewController.m
//  Meboo
//
//  Created by kyo on 2023/10/18.
//

#import "BaseRegisterViewController.h"

@interface BaseRegisterViewController ()

@end

@implementation BaseRegisterViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)pushNextController:(BaseRegisterViewController *)nextVc {

    UIWindow *window = ((AppDelegate*)([UIApplication sharedApplication].delegate)).window;
    [window addSubview:nextVc.view];
    [nextVc.view mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(window);
    }];
    
    nextVc.view.alpha = PushAlpha;
    nextVc.view.transform = CGAffineTransformMakeScale(PushScale,PushScale);
    [UIView animateWithDuration:PushTime animations:^{
        self.view.alpha = PushAlpha;
        self.view.transform = CGAffineTransformMakeScale(PushScale,PushScale);
        
        nextVc.view.alpha = 1;
        nextVc.view.transform = CGAffineTransformMakeScale(1,1);
    } completion:^(BOOL finished) {
        [self.navigationController pushViewController:[[nextVc class] new] animated:NO];
        self.view.alpha = 1;
        self.view.transform = CGAffineTransformMakeScale(1,1);
        [nextVc.view removeFromSuperview];
    }];
}

@end
